
<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    <meta name="keywords" content="">
    <meta name="description" content="">
       <link href="__STATIC__/layout/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__STATIC__/layout/css/animate.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/style.css?v=4.1.0" rel="stylesheet">
  
    <link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
      <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
      <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
</head>

<body style="color:#333;padding:3px;">
     <!-- 标题 -->
    <div class="page-heade">
      <h2 class="title_color text-center">导入物料价格分组对应物料</h2>
    </div>
    <!-- 标题 -->
    <form method="post" class="form-horizontal" enctype="multipart/form-data" id="f1">
    <table class="table table-bordered" style="margin: 0">
       <tr>
        <td>选择导入文件：<input type="file" id="files" name="files" style="display: inline-block;"> <span class="lr_5"></span><button class="btn-info btn" onclick="go_submits()" type="button">导入</button></td>
      </tr>
      <tr>
        <td>
          <p class="colorRed">温馨提示：如果导入过程中出现未满足指掌云系统要求数据，则整份导入资料都将无法导入，必须按照指掌云系统给出的信息提示修改导入资料后再重新导入。</p>
          <p class="padding-10 font-bold">Excel文件导入注意事项：</p>
          <p>1.请仔细阅读下面的价格分组对应产品数据导入格式。并按照注意事项填入正确的数据</p>
          <p class="padding-10">2.分组名称不能为空，且只能是指掌云系统中已经存在的分组名称</p>
          <p>3.物料编号不能为空，且只能是指掌云系统中已存在的产品编号。</p>
          <p class="padding-10">4.物料名称不能为空，且需和产品编号一一对应。</p>
          <p>5.同一分组中，不能存在编号相同的物料。</p>
          <p class="padding-10"><span class="font-bold">Excel文件导入格式：</span><a href="{:url('proinmodel')}">物料价格分组对应产品表格格式.xls</a><span class="colorRed">注：Excel中标记为红色底色的列为必填项。</span></p>
        </td>
      </tr>
    </table><br/><br/><br/><br/>
    <button class="btn-info btn" type="button" onclick="back();">返回列表</button>

    </form>
    <script src="__STATIC__/layout/js/jquery.min.js?v=2.1.4"></script>
    <script src="__STATIC__/layout/js/bootstrap.min.js?v=3.3.6"></script>
      <script src="__STATIC__/layout/js/plugins/sweetalert/sweetalert.min.js"></script>
    <!-- <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> -->
    <script src="__STATIC__/layout/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
    <script>
    function back(){
      location.href='{:url("manage")}';
    }
        //ajax提交
        function go_submits(){
           var formData = new FormData($('#f1')[0]);  
         $.ajax({    
              url: '{:url("new_group_pro")}' ,  /*这是处理文件上传的servlet*/  
              type: 'POST',    
              data: formData,   
              cache: false,    
             contentType: false,  
              processData: false,  
              success: function (re) {    
                //alert(re);
                if(re!=""){
                  var jieguo=JSON.parse(re);
                  if(jieguo["state"]==1){
                          swal({
                    title: "完成",
                    text:  jieguo["msg"],
                    type: "success"
                    },function(){
                      location.href="{:url('manage')}"
                    });
                        }else{
                        swal({
                  title: "错误",
                  text:  jieguo["msg"],
                  type: "warning"
                  });
                        }
                        
                      }else{
                         swal({
                  title: "错误",
                  text:  "系统繁忙请稍后再试",
                  type: "warning"
                  });
                      }
                    },    
                    error: function (re) {    
                        swal({
                  title: "错误",
                  text:  "系统繁忙请稍后再试",
                  type: "warning"
                  });
              }    
         });    
        }
    </script>
    </body>
   
</html>